package com.th.common.enums;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

import java.util.Arrays;

/**
 * 需求订单状态
 * @Author tuhang
 * @PackageName nswcy-crowdsource-back
 * @Package com.th.common.enums
 * @Date 2022/10/3 15:40
 * @Version 1.0
 */
@AllArgsConstructor
@Getter
public enum DemandOrderStatus {


    TO_PICK_UP(1,"待接取"),
    TO_BE_SIGNED(2,"待签订"),
    TO_START_THE(4,"待启动"),
    IN_THE_DESIGN(5,"待签订"),
    NO_EVALUATION(6,"未评价"),
    HAVE_EVALUATION(7,"已评价"),
    ;
    private Integer code;
    private String desc;

    /**
     * 检索需求状态
     * @param code
     * @return
     */
    public static  DemandOrderStatus of(Integer code){
       return Arrays.stream(values()).filter(item -> item.code.equals(code)).findFirst().orElse(null);
    }

}
